#pragma once

#include "BatchTreeItem.h"
#define ID_TREEVIEW 42
#define ID_TREEVIEW_CHANGE_ITEM ID_TREEVIEW + 1
// CBatchTreeCtrl

class AFX_CLASS_EXPORT CBatchTreeCtrl : public CTreeCtrl
{
	DECLARE_DYNAMIC(CBatchTreeCtrl)

public:
	CBatchTreeCtrl();
	virtual ~CBatchTreeCtrl();

	BOOL Create(_In_ DWORD dwStyle, _In_ const RECT& rect, _In_ CWnd* pParentWnd, _In_ UINT nID);		
	void Init(); // Load icons and initialize the tree
	HTREEITEM InsertBatchItem(CBatch batch);
	HTREEITEM InsertPageItem(HTREEITEM hParentItem , int index);
private:
	CImageList      m_imageList;    // Image List that contain the open and close folder icons
	HWND			m_hWnd;	        // handle for CMainFrame class.
	HTREEITEM       m_hRoot;
protected:
	void OnDestroy();
	
	afx_msg void OnTreeSelchanged(NMHDR* pNMHDR, LRESULT* pResult) ;
	afx_msg void OnTreeItemExpanding(NMHDR* pNMHDR, LRESULT* pResult) ;
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	DECLARE_MESSAGE_MAP()
};
